package com.ruoyi.job.service;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.datasource.annotation.Slave;
import com.ruoyi.job.mapper.IusAccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.job.domain.IusAccount;

/**
 * 登陆日志Service业务层处理
 * 
 * @author sxy
 * @date 2021-07-27
 */
@Service
public class IusAccountServiceImpl implements IIusAccountService 
{
    @Autowired
    private IusAccountMapper iusAccountMapper;

    /**
     * 查询登陆日志
     * 
     * @param userId 登陆日志ID
     * @return 登陆日志
     */
    @Override
    @Slave
    public IusAccount selectIusAccountById(String userId)
    {
        return iusAccountMapper.selectIusAccountById(userId);
    }

    /**
     * 查询登陆日志列表
     * 
     * @param iusAccount 登陆日志
     * @return 登陆日志
     */
    @Override
    public List<IusAccount> selectIusAccountList(IusAccount iusAccount)
    {
        return iusAccountMapper.selectIusAccountList(iusAccount);
    }

    /**
     * 新增登陆日志
     * 
     * @param iusAccount 登陆日志
     * @return 结果
     */
    @Override
    public int insertIusAccount(IusAccount iusAccount)
    {
        iusAccount.setCreateTime(DateUtils.getNowDate());
        return iusAccountMapper.insertIusAccount(iusAccount);
    }

    /**
     * 修改登陆日志
     * 
     * @param iusAccount 登陆日志
     * @return 结果
     */
    @Override
    public int updateIusAccount(IusAccount iusAccount)
    {
        iusAccount.setUpdateTime(DateUtils.getNowDate());
        return iusAccountMapper.updateIusAccount(iusAccount);
    }

    /**
     * 批量删除登陆日志
     * 
     * @param userIds 需要删除的登陆日志ID
     * @return 结果
     */
    @Override
    public int deleteIusAccountByIds(String[] userIds)
    {
        return iusAccountMapper.deleteIusAccountByIds(userIds);
    }

    /**
     * 删除登陆日志信息
     * 
     * @param userId 登陆日志ID
     * @return 结果
     */
    @Override
    public int deleteIusAccountById(String userId)
    {
        return iusAccountMapper.deleteIusAccountById(userId);
    }

    @Override
    @Slave
    public void deleteAll() {
        iusAccountMapper.deleteAll();
    }

    @Override
    @Slave
    public void insertLog() {
        iusAccountMapper.insertLog();
    }
}
